/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package PlasticSystem.impl;

import PlasticSystem.Local;
import PlasticSystem.PlasticSystemFactory;
import PlasticSystem.PlasticSystemPackage;
import PlasticSystem.Remote;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.plastic.mrn.*;
import org.plastic.util.*;
import org.plastic.mrn.QoS.*;
import java.util.*;



/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class PlasticSystemPackageImpl extends EPackageImpl implements PlasticSystemPackage
{
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass localEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass remoteEClass = null;

  /**
   * Creates an instance of the model <b>Package</b>, registered with
   * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
   * package URI value.
   * <p>Note: the correct way to create the package is via the static
   * factory method {@link #init init()}, which also performs
   * initialization of the package, or returns the registered package,
   * if one already exists.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see org.eclipse.emf.ecore.EPackage.Registry
   * @see PlasticSystem.PlasticSystemPackage#eNS_URI
   * @see #init()
   * @generated
   */
  private PlasticSystemPackageImpl()
  {
    super(eNS_URI, PlasticSystemFactory.eINSTANCE);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private static boolean isInited = false;

  /**
   * Creates, registers, and initializes the <b>Package</b> for this
   * model, and for any others upon which it depends.  Simple
   * dependencies are satisfied by calling this method on all
   * dependent packages before doing anything else.  This method drives
   * initialization for interdependent packages directly, in parallel
   * with this package, itself.
   * <p>Of this package and its interdependencies, all packages which
   * have not yet been registered by their URI values are first created
   * and registered.  The packages are then initialized in two steps:
   * meta-model objects for all of the packages are created before any
   * are initialized, since one package's meta-model objects may refer to
   * those of another.
   * <p>Invocation of this method will not affect any packages that have
   * already been initialized.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #eNS_URI
   * @see #createPackageContents()
   * @see #initializePackageContents()
   * @generated
   */
  public static PlasticSystemPackage init()
  {
    if (isInited) return (PlasticSystemPackage)EPackage.Registry.INSTANCE.getEPackage(PlasticSystemPackage.eNS_URI);

    // Obtain or create and register package
    PlasticSystemPackageImpl thePlasticSystemPackage = (PlasticSystemPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof PlasticSystemPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new PlasticSystemPackageImpl());

    isInited = true;

    // Create package meta-data objects
    thePlasticSystemPackage.createPackageContents();

    // Initialize created meta-data
    thePlasticSystemPackage.initializePackageContents();

    // Mark meta-data to indicate it can't be changed
    thePlasticSystemPackage.freeze();

    return thePlasticSystemPackage;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getLocal()
  {
    return localEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getLocal_Name()
  {
    return (EAttribute)localEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getLocal_MaxThreads()
  {
    return (EAttribute)localEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getLocal_Remote()
  {
    return (EReference)localEClass.getEStructuralFeatures().get(2);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getRemote()
  {
    return remoteEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getRemote_Name()
  {
    return (EAttribute)remoteEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getRemote_Parent()
  {
    return (EReference)remoteEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getRemote_PotentialThreads()
  {
    return (EAttribute)remoteEClass.getEStructuralFeatures().get(2);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public PlasticSystemFactory getPlasticSystemFactory()
  {
    return (PlasticSystemFactory)getEFactoryInstance();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isCreated = false;

  /**
   * Creates the meta-model objects for the package.  This method is
   * guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void createPackageContents()
  {
    if (isCreated) return;
    isCreated = true;

    // Create classes and their features
    localEClass = createEClass(LOCAL);
    createEAttribute(localEClass, LOCAL__NAME);
    createEAttribute(localEClass, LOCAL__MAX_THREADS);
    createEReference(localEClass, LOCAL__REMOTE);

    remoteEClass = createEClass(REMOTE);
    createEAttribute(remoteEClass, REMOTE__NAME);
    createEReference(remoteEClass, REMOTE__PARENT);
    createEAttribute(remoteEClass, REMOTE__POTENTIAL_THREADS);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isInitialized = false;

  /**
   * Complete the initialization of the package and its meta-model.  This
   * method is guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void initializePackageContents()
  {
    if (isInitialized) return;
    isInitialized = true;

    // Initialize package
    setName(eNAME);
    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes

    // Initialize classes and features; add operations and parameters
    initEClass(localEClass, Local.class, "Local", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getLocal_Name(), ecorePackage.getEString(), "name", null, 1, 1, Local.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getLocal_MaxThreads(), ecorePackage.getEInt(), "maxThreads", null, 1, 1, Local.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getLocal_Remote(), this.getRemote(), this.getRemote_Parent(), "remote", null, 0, -1, Local.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);

    initEClass(remoteEClass, Remote.class, "Remote", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getRemote_Name(), ecorePackage.getEString(), "name", null, 1, 1, Remote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getRemote_Parent(), this.getLocal(), this.getLocal_Remote(), "parent", null, 0, 1, Remote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getRemote_PotentialThreads(), ecorePackage.getEInt(), "potentialThreads", null, 1, 1, Remote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    // Create resource
    createResource(eNS_URI);

    // Create annotations
    // http://www.sei.pku.edu.cn/rsa
    createRsaAnnotations();
    // http:///jp.ac.u_tokyo.wrapper.AttributeAnnotations
    createJpAnnotations();
  }

  /**
   * Initializes the annotations for <b>http://www.sei.pku.edu.cn/rsa</b>.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected void createRsaAnnotations()
  {
    String source = "http://www.sei.pku.edu.cn/rsa";		
    addAnnotation
      (localEClass, 
       source, 
       new String[] 
       {
       "RootClass", "true"
       });				
  }

  /**
   * Initializes the annotations for <b>http:///jp.ac.u_tokyo.wrapper.AttributeAnnotations</b>.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected void createJpAnnotations()
  {
    String source = "http:///jp.ac.u_tokyo.wrapper.AttributeAnnotations";			
    addAnnotation
      (getLocal_Name(), 
       source, 
       new String[] 
       {
       "KeyAttribute", "true"
       });		
    addAnnotation
      (getLocal_MaxThreads(), 
       source, 
       new String[] 
       {
       "KeyAttribute", "true"
       });		
    addAnnotation
      (getRemote_Name(), 
       source, 
       new String[] 
       {
       "KeyAttribute", "true"
       });		
    addAnnotation
      (getRemote_PotentialThreads(), 
       source, 
       new String[] 
       {
       "KeyAttribute", "true"
       });
  }

  /*Global utility methods are generated here*/
    
} //PlasticSystemPackageImpl
